import Vue from 'vue'
import VueRouter from 'vue-router'
import Shop from '@/views/app/Shop.vue'

Vue.use(VueRouter)

import AppRoute from '@/views/app/route'
import ErrorPageRoute from '@/views/ErrorPage/route'
import LoginRoute from '@/views/login/route'
import GoodRoute from '@/views/good/route'
import MyRoute from '@/views/my/route'

const routes = [{
    path: '/',
    redirect: {
      name: 'shop'
    },
  },
  ...AppRoute,
  ...ErrorPageRoute,
  ...LoginRoute,
  ...GoodRoute,
  ...MyRoute,
  {
    path: '*',
    redirect: {
      name: 'notfound'
    }
  }
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
